Skip to main content

Ruby Setup Instructions

Follow these steps to set up and use the Ruby license generator script in this repository.

1. Clone the Repository

git clone https://github.com/callmerocco/li-cen-se.git
cd li-cen-se

2. Install Ruby

Ensure you have Ruby installed (version 2.5 or higher recommended).
Check your Ruby version:

ruby --version

If you need to install Ruby, use rbenv, rvm, or your OS package manager.

3. Install Required Gems

This script uses only Ruby standard libraries, so no extra gems are required.

4. Prepare Required Files

  • Ensure you have a licenses.json file in the project root. This should contain license templates in JSON format.
  • (Optional) Create a .env file in the project root and add your OpenAI API key:
    OPENAI_API_KEY=your-openai-api-key-here

5. Run the Script

ruby path/to/your_script.rb

Replace path/to/your_script.rb with the actual filename if different.

6. Usage

  • The script will prompt you to select a license type or choose "AI-generated".
  • Enter your name, project name, and year when prompted.
  • If you select "AI-generated", describe your custom license idea.
  • The script will generate a LICENSE file in the current directory.

7. Troubleshooting

  • If you see Error: OPENAI_API_KEY not set in environment., make sure your .env file exists and contains your API key, or set the environment variable manually:
    export OPENAI_API_KEY=your-openai-api-key-here

For more details, see the repo here.